<!DOCTYPE html>
<head>
    <title>用户管理</title>
	<!-- 插入列表依赖资源 -->
	<!-- #include /base/meta/base_header -->
	
	<!-- #include /base/meta/date -->
	
	<!-- #include /base/meta/grid -->
	
	<!-- #include /base/meta/wui -->

</head>
<body>
    <div class="portlet">
        <div class="portlet-title">
            <i class="fa fa-circle-o"></i><script type="text/javascript">document.write(document.title)</script>
        </div>
        <div class="portlet-body">
            <div class="wui-grid grid-table">
            	<div class="wui-grid-searchBar">
                    <table class="table table-responsive wui-grid-table">
                        <tbody>
                            <tr>
                                <td class="td-title" style="text-align: right">姓名</td>
                                <td class="td-content">
                                    <input type="text" id="name" data-searchrule='{"field":"name","op":"cn","type":"text"}' class="wui-input">
                                </td>
                                <td class="td-title" style="text-align: right">生日</td>
                                <td class="td-content">
                                    <div class="input-group">
                                        <input type="text" id="birthday1" data-init-wui="date" data-searchrule='{"field":"birthday","op":"ge","type":"date"}' />
                                        <span class="input-group-addon" id="basic-addon2">-</span>
                                        <input type="text" id="birthday2" data-init-wui="date" data-searchrule='{"field":"birthday","op":"le","type":"date"}' />
                                    </div>
                                </td>
                                <td class="td-title" style="text-align: right">性别</td>
                                <td class="td-content">
                                    <select id="sex" data-searchrule='{"field":"sex","op":"eq","type":"text"}' class="wui-select">
                                    	<option value="">请选择</option>
                                    	<option value="woman">女</option>
                                    	<option value="man">男</option>
                                    </select>
                                </td>
                                <td rowspan="2" class="td-button">
                                    <a wui-grid-action="search" href="javascript:void(0)" title="查询" class="wui-btn wui-btn-blue">
                                        <i class="fa fa-search"></i>    
                                    </a>    
                                    <a wui-grid-action="reset" href="javascript:void(0)" title="刷新" class="wui-btn wui-btn-default">
                                        <i class="fa fa-refresh"></i>    
                                    </a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="toolbar w-grid-toolbar">
                    <a id="btnAdd" href="javascript:void(0)" class="wui-btn wui-btn-blue">
                        <span class="ladda-label">
                            <i class="fa fa-plus"></i> 新增
                        </span>
                    </a>                
                    <a id="btnDeletes" href="javascript:void(0)" class="wui-btn wui-btn-default">
                        <span class="ladda-label">
                            <i class="fa fa-remove"></i> 批量删除
                        </span>
                    </a>
                </div>
                <table id="grid-table"></table>
            </div>
        </div>
    </div>
    
    <script src="/scripts/demo/user/userListController.js?t=1" type="text/javascript"></script>
    <script src="/scripts/demo/user/userService.js?t=1" type="text/javascript"></script>
    
    <script>
	 	// 全局变量
	    var uiGrid = null;
 
        $(document).ready(function (){

        	var owidget = wui.init();
        	
        	// 初始化网格
            var config = userService.getGridConfig(gridComplete);
            config.isShowSearchBar = false;
            /* config.url = "http://111.230.47.180:7070/UserServer.aspx"; */
            uiGrid = wui.grid("grid-table", config);
                
        	// 给新增按钮添加点击事件
            $("#btnAdd").on("click", function(){
                openForm("add");
            })

        	// 给批量删除按钮添加点击事件
            $("#btnDeletes").on("click", function(){
                openForm("add");
            })

        }); // end $(document).ready(function ()
         
    </script>
    
    <script id="operationTemplate" type="text/html">
        <div class="grid-opt">
            <a _action="view" href="javascript:void(0)" class="form-btn wui-bg-blue" title="查询" _id="{{id}}"><i class="fa fa-search"></i></a>
            <a _action="edit" href="javascript:void(0)" class="form-btn wui-bg-orange" title="编辑" _id="{{id}}"><i class="fa fa-edit" ></i></a>
            <a _action="delete" href="javascript:void(0)" class="form-btn wui-bg-black04" title="删除" _id="{{id}}"><i class="fa fa-remove" ></i></a>
        </div>
    </script>
       
</body>